package org.example.shop.pojo;

import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Mapping;

import javax.persistence.Id;


/**
 * ES中商品的文档对象模型
 */
@Data
@Document(indexName = "myshop-goods-info")
@Accessors(chain = true)
@ToString
public class Goods {
    @Id
    private Integer id;
    @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_smart") //
    private String title;
    private String picture;
    private Double price;
}
